package com.lxit.video.dao;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import com.lxit.video.bean.VideoComment;

public interface VideoCommentRepository extends JpaRepository<VideoComment, Integer>, VideoCommentDao {
	// 用户id,评论详情,视频id,评论时间;
	@Modifying
	@Query(value="insert into video_comment (commentator,comment_details,video_id,comment_time) values (:userId,:commentDetails,:videoId,now())",nativeQuery=true)
	int saveVideoComment(@Param("userId") Integer userId, @Param("commentDetails") String commentDetails,
			@Param("videoId") Integer videoId);
}